home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1446 / smallbac.bat < prev    next >
Encoding:
DOS Batch File  |  1997-02-04  |  4.4 KB  |  125 lines

  1. @echo off
  2. cls
  3. echo. 
  4. echo This batch file is provide as is.  Use it at your own risk.
  5. echo. 
  6. echo Since it does minimal error checking and there are so many 
  7. echo varables pertaining to how Win95 may be installed, it may
  8. echo not work on your system.
  9. echo. 
  10. echo In most cases the worst that can happen is that a directory
  11. echo named SMALLREG will be created under your WINDOWS directory and
  12. echo it will not contain a proper set of backup files.
  13. echo.
  14. pause Press CTRL-BREAK to cancel, or any other key to proceed at your own risk:
  15. cls
  16. if "%1"=="" goto :ERRORMSG
  17. if "%windir%"=="" goto :WINDIR
  18. if "%windir%\command"=="" goto :WINDIR
  19. if not exist %1\*.* goto :BADDRIVE
  20. if not exist %windir%\*.* goto :BADWINDIR
  21. if not exist %windir%\system.dat goto :NOWIN
  22. if not exist %windir%\command\attrib.exe goto :NOATTRIB
  23. if exist %windir%\smallreg\*.* goto :SMALLREGFILES
  24. cls
  25. echo. 
  26. echo. 
  27. echo This batch file will create the directory %windir%\SmallReg 
  28. echo and copy the following files (if they exist) to it as backups.
  29. echo. 
  30. echo      %1\MSDOS.SYS
  31. echo      %windir%\SYSTEM.DAT
  32. echo      %windir%\SYSTEM.DA0
  33. echo      %windir%\USER.DAT
  34. echo      %windir%\USER.DA0
  35. echo      %windir%\SYSTEM.INI
  36. echo      %windir%\WIN.INI
  37. echo      %windir%\ShellIconCache
  38. echo      %windir%\SYSTEM.CB
  39. echo      %windir%\IOS.LOG
  40. echo      %windir%\TTFCACHE
  41. echo. 
  42. pause Press CTRL-BREAK now to cancel, or any other key to continue: 
  43. md %windir%\SmallReg
  44. %1
  45. cd %windir%
  46. :RESETATTRIB
  47. if exist %1\msdos.sys %windir%\command\attrib -s -r -h %1\msdos.sys
  48. if exist %windir%\system.dat %windir%\command\attrib -s -r -h system.dat
  49. if exist %windir%\system.da0 %windir%\command\attrib -s -r -h system.da0
  50. if exist %windir%\user.dat %windir%\command\attrib -s -r -h user.dat
  51. if exist %windir%\user.dat %windir%\command\attrib -s -r -h user.da0
  52. if exist %windir%\shelli~1 %windir%\command\attrib -h shelli~1
  53. if exist %windir%\ttfcache %windir%\command\attrib -h ttfcache
  54. :COPYFILES
  55. echo. 
  56. echo Copying files now, please wait....
  57. echo. 
  58. if exist %1\msdos.sys copy %1\msdos.sys smallreg > nul
  59. if exist %windir%\system.dat copy system.dat smallreg > nul
  60. if exist %windir%\system.da0 copy system.da0 smallreg > nul
  61. if exist %windir%\user.dat copy user.dat smallreg > nul
  62. if exist %windir%\user.da0 copy user.da0 smallreg > nul
  63. if exist %windir%\system.ini copy system.ini smallreg > nul
  64. if exist %windir%\win.ini copy win.ini smallreg > nul
  65. if exist %windir%\shelli~1 copy shelli~1 smallreg > nul
  66. if exist %windir%\system.cb copy system.cb smallreg > nul
  67. if exist %windir%\ios.log copy ios.log smallreg > nul
  68. if exist %windir%\ttfcache copy ttfcache smallreg > nul
  69. :RESETATTRIB
  70. if exist %1\msdos.sys %windir%\command\attrib +s +r +h %1\msdos.sys
  71. if exist %windir%\system.dat %windir%\command\attrib +s +r +h system.dat
  72. if exist %windir%\system.da0 %windir%\command\attrib +s +r +h system.da0
  73. if exist %windir%\user.dat %windir%\command\attrib +s +r +h user.dat
  74. if exist %windir%\user.dat %windir%\command\attrib +s +r +h user.da0
  75. if exist %windir%\shelli~1 %windir%\command\attrib +h shelli~1
  76. if exist %windir%\ttfcache %windir%\command\attrib +h ttfcache
  77. cd %windir%\smallreg
  78. goto :END
  79. :BADDRIVE
  80. cls
  81. echo. 
  82. echo The drive %1 either does not exist or it contains no files, 
  83. echo are you sure you entered your Drive letter directory correctly.
  84. goto :ERRORMSG
  85. :BADWINDIR
  86. cls
  87. echo. 
  88. echo The directory %windir% either does not exist or it contains no files, 
  89. goto :END
  90. :NOWIN
  91. cls
  92. echo. 
  93. echo The file SYSTEM.DAT can not be found in %windir% 
  94. goto :END
  95. :NOATTRIB
  96. cls
  97. echo. 
  98. echo This batch file requires ATTRIB.EXE to be in %windir%\COMMAND, but
  99. echo it could not be found there.  Correct the problem and try again.
  100. goto :END
  101. :SMALLREGFILES
  102. cls
  103. echo. 
  104. echo There are already files in %windir%\SmallReg.  For safety reasons,
  105. echo this batch file will not over write existing files.  To continue, you
  106. echo must manually delete the files in %windir%\SmallReg.  
  107. echo. 
  108. echo Before deleting them make sure you do not need them.  
  109. echo. 
  110. echo If you think that you might need them later, make another directory 
  111. echo and copy them there before deleting them.
  112. goto :END
  113. :WINDIR
  114. echo. 
  115. echo It appears that you are in real DOS mode.  This batch file 
  116. echo must be run from within Win95 or a Win95 Dos Window.
  117. goto :END
  118. :ERRORMSG
  119. echo. 
  120. echo Correct syntax is:   SMALLBAC d:
  121. echo. 
  122. echo     where d: = Drive (with colon) containing your MSDOS.SYS file
  123. :END
  124. echo. 
  125.